package com.student.model;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * OperationRecord entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Operation_Record", schema = "dbo", catalog = "StudentManager")
public class OperationRecord implements java.io.Serializable {

	// Fields

	private Long operationRecordId;
	private OperationType operationType;
	private Timestamp operationRecordTime;
	private String operationRecordContent;

	// Constructors

	/** default constructor */
	public OperationRecord() {
	}

	/** minimal constructor */
	public OperationRecord(Long operationRecordId,
			Timestamp operationRecordTime, String operationRecordContent) {
		this.operationRecordId = operationRecordId;
		this.operationRecordTime = operationRecordTime;
		this.operationRecordContent = operationRecordContent;
	}

	/** full constructor */
	public OperationRecord(Long operationRecordId, OperationType operationType,
			Timestamp operationRecordTime, String operationRecordContent) {
		this.operationRecordId = operationRecordId;
		this.operationType = operationType;
		this.operationRecordTime = operationRecordTime;
		this.operationRecordContent = operationRecordContent;
	}

	// Property accessors
	@Id
	@Column(name = "Operation_Record_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getOperationRecordId() {
		return this.operationRecordId;
	}

	public void setOperationRecordId(Long operationRecordId) {
		this.operationRecordId = operationRecordId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Operation_Type_id")
	public OperationType getOperationType() {
		return this.operationType;
	}

	public void setOperationType(OperationType operationType) {
		this.operationType = operationType;
	}

	@Column(name = "Operation_Record_Time", nullable = false, length = 23)
	public Timestamp getOperationRecordTime() {
		return this.operationRecordTime;
	}

	public void setOperationRecordTime(Timestamp operationRecordTime) {
		this.operationRecordTime = operationRecordTime;
	}

	@Column(name = "Operation_Record_Content", nullable = false)
	public String getOperationRecordContent() {
		return this.operationRecordContent;
	}

	public void setOperationRecordContent(String operationRecordContent) {
		this.operationRecordContent = operationRecordContent;
	}

}